@echo off
:: 如果批处理文件是UTF-8编码，使用此命令
chcp 65001 > nul

if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin

:: 定义日志文件路径
set LOG_FILE=%~dp0Update.log

:: --- 开始写入日志 ---
echo ================================================= >> %LOG_FILE%
echo [执行时间] %date% %time% >> %LOG_FILE%
echo. >> %LOG_FILE%
echo [Update 结果] >> %LOG_FILE%
git -C "%cd%" pull >> %LOG_FILE% 2>&1
echo. >> %LOG_FILE%
echo [执行结束] >> %LOG_FILE%
echo. >> %LOG_FILE%